package blog.controller;

import blog.pojo.Comments;
import blog.pojo.ResultVo;
import blog.service.CommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author HuLin
 * @version 1.0
 * @date 2022/9/16 9:59
 */
@RestController
@RequestMapping("/comment")
public class CommentController {
    @Autowired
    private CommentService commentService;

    @PostMapping
    public ResultVo addComments(@RequestBody Comments comments){
        return commentService.addComments(comments);
    }

    @DeleteMapping("{cid}")
    public ResultVo delComments(@PathVariable Integer cid){
        return commentService.delComments(cid);
    }
}
